<?php
if(!defined('DEDEINC'))
{
	exit("Request Error!");
}

function plus_hospital(&$atts,&$refObj,&$fields)
{
	global $dsql,$_vars,$envs;
	$attlist="row=24,titlelen=24,flag=0,city=";
	
	FillAtts($atts,$attlist);
	FillFields($atts,$fields,$refObj);
	extract($atts, EXTR_OVERWRITE);
	
	$totalrow = $row;
	$revalue = '';
	$where = ' 1 ';
	if($flag =='c')
	{
		$where .= 'AND recommend=1 ';
	}
	if(!empty($city))
	{
		$where .= ' and yid='. int($city);
	}
	$equery = "select * from `#@__hospital` where $where limit 0,$totalrow";
	
	$dsql->SetQuery($equery);
	$dsql->Execute('hos');
	while($dbrow=$dsql->GetArray('hos'))
	{
 		$revalue[] = $dbrow;
	}
	return $revalue;
}
?>